package com.ruoyi.project.xkx.school.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.project.xkx.school.domain.XkxSchool;
import com.ruoyi.project.xkx.school.mapper.XkxSchoolMapper;
import com.ruoyi.project.xkx.school.service.IXkxSchoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 校区Service业务层处理
 *
 * @author ...
 * @date 2021-05-09
 */
@Service
public class XkxSchoolServiceImpl extends ServiceImpl<XkxSchoolMapper,XkxSchool> implements IXkxSchoolService {

  @Autowired
  private XkxSchoolMapper xkxSchoolMapper;
  /**
   * 查询校区
   *
   * @param schoolId 校区ID
   * @return 校区
   */
  @Override
  public XkxSchool selectXkxSchoolById(Integer schoolId) {
    return xkxSchoolMapper.selectXkxSchoolById(schoolId);
  }

  /**
   * 查询校区列表
   *
   * @param xkxSchool 校区
   * @return 校区
   */
  @Override
  public List<XkxSchool> selectXkxSchoolList(XkxSchool xkxSchool) {
    return xkxSchoolMapper.selectXkxSchoolList(xkxSchool);
  }

  /**
   * 新增校区
   *
   * @param xkxSchool 校区
   * @return 结果
   */
  @Override
  public int insertXkxSchool(XkxSchool xkxSchool) {
    return xkxSchoolMapper.insertXkxSchool(xkxSchool);
  }

  /**
   * 修改校区
   *
   * @param xkxSchool 校区
   * @return 结果
   */
  @Override
  public int updateXkxSchool(XkxSchool xkxSchool) {
    return xkxSchoolMapper.updateXkxSchool(xkxSchool);
  }

  /**
   * 批量删除校区
   *
   * @param schoolIds 需要删除的校区ID
   * @return 结果
   */
  @Override
  public int deleteXkxSchoolByIds(Integer[] schoolIds) {
    return xkxSchoolMapper.deleteXkxSchoolByIds(schoolIds);
  }

  /**
   * 删除校区信息
   *
   * @param schoolId 校区ID
   * @return 结果
   */
  @Override
  public int deleteXkxSchoolById(Integer schoolId) {
    return xkxSchoolMapper.deleteXkxSchoolById(schoolId);
  }
}
